package com.zj.fx.model.rpa;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class RpaTaskDtl implements Serializable {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "主任务id")
    private String rpataskid;

    @ApiModelProperty(value = "主任务名称")
    private String rpataskname;

    @ApiModelProperty(value = "对应指标id")
    private String targetid;

    @ApiModelProperty(value = "类型编号")
    private String typenum;

    @ApiModelProperty(value = "执行周期（1月度2季度3年度）")
    private String periodtype;

    @ApiModelProperty(value = "对应任务年月")
    private String taskmonth;

    @ApiModelProperty(value = "是否完成数据推送（0否1是）")
    private String pushstate;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "推送完成时间")
    private Date pushtime;

    @ApiModelProperty(value = "推送数据条数")
    private String pushcount;

    @ApiModelProperty(value = "是否完成有效数据转换（0否1是）")
    private String transstate;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "转换完成时间")
    private Date transtime;

    @ApiModelProperty(value = "转换数据条数")
    private String transcount;

    @ApiModelProperty(value = "是否完成数据自动填写（0否1是）")
    private String fillstate;

    @ApiModelProperty(value = "自动填写条数")
    private String fillcount;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "自动填写完成时间")
    private Date filltime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "任务明细生成时间")
    private Date createtime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "最近更新时间")
    private Date updatetime;


    public RpaTaskDtl(String id, String rpataskid, String rpataskname, String targetid, String typenum, String periodtype, String taskmonth, String pushstate, Date pushtime, String pushcount, String transstate, Date transtime, String transcount, String fillstate, String fillcount, Date filltime, Date createtime, Date updatetime) {

        this.id = id;

        this.rpataskid = rpataskid;

        this.rpataskname = rpataskname;

        this.targetid = targetid;

        this.typenum = typenum;

        this.periodtype = periodtype;

        this.taskmonth = taskmonth;

        this.pushstate = pushstate;

        this.pushtime = pushtime;

        this.pushcount = pushcount;

        this.transstate = transstate;

        this.transtime = transtime;

        this.transcount = transcount;

        this.fillstate = fillstate;

        this.fillcount = fillcount;

        this.filltime = filltime;

        this.createtime = createtime;

        this.updatetime = updatetime;

    }

    public RpaTaskDtl() {
        super();
    }

    public String dateToStringConvert(Date date) {
        if (date != null) {
            return DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
        }
        return "";
    }


}